home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / GDIDEMO.PAK / ARTYPRIV.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  69 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1991, 1995 by Borland International, All Rights Reserved
  4. //
  5. //   Helper classes used internally by the TArtyWindow
  6. //----------------------------------------------------------------------------
  7. #if !defined(ARTYINTERNAL_H)
  8. #define ARTYINTERNAL_H
  9.  
  10. #include <winsys\color.h>
  11.  
  12. class _EXPCLASS TDC;
  13. class _EXPCLASS TPen;
  14.  
  15. // Arty demo constants 
  16. const int   MaxLineCount      =  100;
  17. const int   MaxIconicLineCount=  5;
  18. const int   MaxColorDuration  =  10;
  19.  
  20.  
  21. struct TLineRec {
  22.   int    LX1,LY1, LX2,LY2;
  23.   TColor Color;
  24. };
  25.  
  26. class TList {
  27.   public:
  28.     TList(int _max);
  29.     void Redraw(TDC&);
  30.     void ResetLines();
  31.     void ScaleTo(int, int);
  32.     void LineTick(TDC&);
  33.  
  34.   protected:
  35.     TLineRec  Line[MaxLineCount];
  36.     int       Xmax, Ymax;
  37.  
  38.     void AdjustX(int&, int&);
  39.     void AdjustY(int&, int&);
  40.  
  41.     virtual void DrawLine(TDC&, int);
  42.     virtual void EraseLine(TDC&, int);
  43.  
  44.     void SelectNewColor();
  45.     void SelectNewDeltaValues();
  46.  
  47.   private:
  48.     int  MaxLines;
  49.     int  X1, Y1, X2, Y2;
  50.     int  MaxDelta;
  51.     int  ColorDuration;
  52.     int  IncrementCount;
  53.     int  DeltaX1, DeltaY1, DeltaX2, DeltaY2;
  54.     int  CurrentLine;
  55.     long PenColor;
  56. };
  57.  
  58. // Quads draw 4 reflections of each line
  59. //
  60. class TQuadList : public TList {
  61.   public:
  62.     TQuadList(int _max) : TList(_max) {}
  63.  
  64.     void DrawLine(TDC&, int);
  65.     void EraseLine(TDC&, int);
  66. };
  67.  
  68. #endif  //  ARTYINTERNAL_H
  69.